﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>平移到某地理点</title>
    <script src="../../lib/XiaoFuMap.js" type="text/javascript"></script>
    <script type="text/javascript">
        var map;
        function load() {
            map = new XiaoFu.Map("#MapContainer");
            var layer = new XiaoFu.GoogleCacheLayer(GoogleUrl.Map);
            map.addLayer(layer);
        }
        function showMsg(_msg) {
            $("#msg").html(_msg);
        }
        function panTo() {
            var point = new XiaoFu.GeoPoint(12956687.790563654,4853751.2961087);
            map.panTo(point);
        }
        function panByDynamic(evt) {map.dynamicPan = (evt.value == "true");};
    </script>
</head>
<body onload="load()">
    <div id="MapContainer" style="z-index: 10000; border: 1px solid blue; position: relative;
        width: 1000px; height: 500px;">
    </div> 
    <label >是否动态平移</label>
    <select onchange="panByDynamic(this);" ><option value="true">是</option><option value="false" >否</option></select>
    <input type="button" value="平移到北京" onclick="panTo()" />
    <div id="msg">
    </div>
</body>
</html>
